Socket
Socket
Sign inDemoInstall

bcrypt-pbkdf

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bcrypt-pbkdf

Port of the OpenBSD bcrypt_pbkdf function to pure JS


Version published
Weekly downloads
17M
increased by4.13%
Maintainers
4
Weekly downloads
 
Created

What is bcrypt-pbkdf?

The bcrypt-pbkdf package is a node.js library that implements Password-Based Key Derivation Function 2 (PBKDF2) with bcrypt as its pseudorandom function. This allows for the secure derivation of keys from passwords, which can then be used for cryptographic operations such as encryption, decryption, and authentication. It is particularly useful in scenarios where password security is paramount.

What are bcrypt-pbkdf's main functionalities?

Key Derivation

This feature demonstrates how to derive a key from a password using the bcrypt-pbkdf package. The `pbkdf2Sync` function takes a password, salt, number of iterations (rounds), desired key length, and hash function as arguments, and returns a derived key. This is useful for generating secure keys for encryption or authentication purposes.

"use strict";
const bcrypt_pbkdf = require('bcrypt-pbkdf');
const password = 'mysecretpassword';
const salt = 'somesalt';
const keyLength = 32; // Desired length of the derived key
const rounds = 10; // Number of iterations

const derivedKey = bcrypt_pbkdf.pbkdf2Sync(password, salt, rounds, keyLength, 'sha256');
console.log(derivedKey.toString('hex'));

Other packages similar to bcrypt-pbkdf

FAQs

Package last updated on 29 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc